package features.advance.demo;


import java.time.DayOfWeek;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) throws Exception {
        Map map1 = new HashMap(16);
        Map map2 = new HashMap(16);
        map1.put("1","2");
        map1.put("3","2");
        map2.put("2","1");
        map2.put("3","2");
        // 验证HashMap的hashCode方法
        System.out.println(map1.hashCode() == map2.hashCode());
    }


}
class demo{
    public void demo(){
        //        demo_A demo_a = new demo_A();
//        demo_B demo_b = new demo_B();
////        demo_a.test_A();
//        Method method = demo_B.class.getMethod("test_A");
//        // 获取子类重写的方法
//        System.out.println(method);
//        Object invoke = method.invoke(demo_b, null);
//        System.out.println(invoke);
//
//        Object test_a1 = demo_B.class.getSuperclass().getMethod("test_A").invoke(demo_a, null);
//        System.out.println(test_a1);
//
//        Method test_a = demo_B.class.getDeclaredMethod("test_A");
//        System.out.println(test_a);

        TreeSet<Object> treeSet = new TreeSet<>();
        boolean b = treeSet.stream().anyMatch(e -> {
            System.out.println(e);
            return e == null;
        });

        System.out.println(1 << 4);
        DayOfWeek friday = DayOfWeek.FRIDAY;
        System.out.println(friday.toString());
        Map<DayOfWeek,String> map = new EnumMap(DayOfWeek.class);
        map.put(friday,"Friday");
    }

    public void springcycledependence(){
        A a = new A(new B(new C(new A(new B(new C(new A()))))));
    }

    class A{
        B b;

        public void setB(B b) {
            this.b = b;
        }
        public A(){

        }
        public A(B b){
            this.b = b;
        }
    }
    class B{
        C c;

        public void setC(C c) {
            this.c = c;
        }
        public B(){

        }
        public B(C c){
            this.c = c;
        }
    }
    class C{
        A a;

        public void setA(A a) {
            this.a = a;
        }
        public C(){

        }
        public C(A a){
            this.a = a;
        }
    }
}
